home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Utilities
/
Programming
/
EnterAct 3.7.3
/
EnterAct Code Templates
next >
Wrap
Text File
|
1996-06-14
|
4KB
|
277 lines
About templates and this file format
------------------------------------
If you didn't read the manual, you'll want to know how to use this:
type the name of an entry, then hit <command><return> to replace
the name with its template. To advance to the next logical insertion
point, keep hitting <command><return>. Case counts in the template name.
hAWK templates are a special case (see the first entries below): if your
entry name expands to something that starts with "hAWK", EnterAct will
select all of it instead of advancing the insertion point. And if you
press <command><return> with a hAWK template selected, EnterAct will
run the hAWK program. You can also press <enter> to run a selected program.
If you change and save this file with EnterAct, changes take effect
immediately (no need to restart EnterAct). Keep this file in the same
folder where you have EnterAct, at the same level, and don't change its name.
Please change this file to suit your needs--just follow the rules below.
Feel free to add or delete entries, or change entry names or contents.
Keep each entry in an ENTRY/END sandwich. Following ENTRY, on a new line
put the name of the template--note it can contain any non-blank characters.
Put the template (or definition if you like) for the name on a new line
immediately below the name line. Each template ends with "END" on a new
line. Arbitrary text like this is OK between entries (just don't start any
comment line, or for that matter any line inside a template,
with "ENTRY" or "END").
If you put the special symbol '@' in your template, then insertion
point advances (automatic when you put in a template, command-return
thereafter) will stop at the '@' and select it. Non-code insertion points
should be specially marked with '@', but you mostly don't have to specially
mark obvious places in a C or C++ code template.
Keep all your entries flush-left, and EnterAct will adjust your indentation
when pasting your template in. Just open up a new line and tab in to the
right position before typing the entry name and pressing <command><return>.
Tip: if you change your templates a lot, add this file to your "Locations" menu.
First up, some hAWK templates:
ENTRY
echo
hAWK -f$EchoFullPathNames -- MFS
END
ENTRY
compare
hAWK -f$CompareFiles -- MFS
END
ENTRY
boiler
hAWK -f$BoilerPlate -vputInComment=1 -vfile="@.c"
-vauthor="KE" -vcompany="bdibdi" -ss
END
ENTRY
time
hAWK -f$Time
END
ENTRY
ff
hAWK -f$FormatFunctionIntro
END
Some standard templates:
ENTRY
for
for (; ; )
{
}
END
ENTRY
fori
for (i = 0; i < @; ++i)
{
}
END
ENTRY
while
while ()
{
}
END
ENTRY
switch
switch ()
{
case :
break;
default:
break;
}
END
ENTRY
switch'
switch ()
{
case '':
break;
default:
break;
}
END
ENTRY
if
if ()
{
}
END
ENTRY
else
else
{
}
END
ENTRY
ife
if ()
{
}
else
{
}
END
ENTRY
iff
if ()
{
}
else if ()
{
}
END
ENTRY
elif
else if ()
{
}
END
ENTRY
do
do
{
} while ();
END
ENTRY
struct
typedef struct @
{
; //
} @, *@Ptr;
END
If you type something a lot--make a template for it!
Error checking, maybe...
ENTRY
e
if (theErr == noErr)
{
}
END
...or looping a lot
ENTRY
while--
while (--@ >= 0)
{
}
END
A quick&dirty file top (see "boiler" above if you want a time stamp)
ENTRY
top
/****
File.....: @
Date.....: @, 1996
.........: © 1996 yourCompany / yourname. All rights reserved.
Status...: under development
Spec.....: @
****/
END
ENTRY
i
#include "@.h"
END
Make a quick comment by typing just a forward slash, then cmd-return:
ENTRY
/
/* @
*/
END
Start up a function definition
ENTRY
func
/* @
*/
OSErr @
(, //
//
)
{
}
END
Dereference a Handle
ENTRY
d
(**@).@
END
An HTML template
ENTRY
html
<HTML>
<HEAD>
<TITLE>@</TITLE>
</HEAD>
<BODY>
<H1>@</H1>
<P>@</P>
</BODY>
</HTML>
END
OK, your turn...a template for a class or enum, perhaps?